<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo (C("SYS_TITLE")); ?></title>
<link href="/wwyl/Public/Admin/css/style.css" rel="stylesheet" type="text/css" />
<link href="/wwyl/Public/Admin/css/page.css" rel="stylesheet" type="text/css" />
<style>
.file {width:102px;height:34px;opacity:0;filter:alpha(opacity=0);cursor:pointer;}
<!--权限样式-->
#wrap a{text-decoration:none; color:#000;}
#wrap a:hover{ color:#CCC;}
#wrap{ width:94%; height:auto; overflow:hidden; margin:20px auto; padding:10px 20px; border:1px solid #ccc;}
#wrap .add-app{ display:block; width:100px; height:20px; line-height:20px; text-align:center; background:#670768; color:#fff; border-radius:4px;}
#wrap .app{ padding:5px; border:1px solid #f6f6f6; border-radius:4px; width:1000px;}
#wrap .app p{ height:20px; line-height:20px;}
#wrap .app p strong{ font-size:20px; color:#0b99d8}
#wrap .app dl{ margin:10px 0; border:1px solid #f6f6f6; height:auto; overflow:hidden;border-radius:4px;}
#wrap .app dl dt{ display:block; height:25px; line-height:25px; background:#e6e6fa; text-indent:25px;}
#wrap .app dl dt strong{ font-size:14px; color:#61a1fa;}
#wrap .app dl dd{ margin:5px; display:block; height:18px;; width:185px; line-height:18px; text-align:left;  float:left; font-size:16px;} 
</style>

<!--编辑器-->
<script type="text/javascript" src="/wwyl/Public/Admin/js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="/wwyl/Public/Admin/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="/wwyl/Public/Admin/ueditor/ueditor.all.min.js"></script>

<!---->
<script language="JavaScript" src="/wwyl/Public/Admin/js/jquery.js"></script>
<script type="text/javascript">
	$(function(){	
		//顶部导航切换
		$(".nav li a").click(function(){
			$(".nav li a.selected").removeClass("selected")
			$(this).addClass("selected");
		})	
	})	
	
	$(function(){	
		//导航切换
		$(".menuson li").click(function(){
			$(".menuson li.active").removeClass("active")
			$(this).addClass("active");
		});
		
		$('.title').click(function(){
			var $ul = $(this).next('ul');
			$('dd').find('ul').slideUp();
			if($ul.is(':visible')){
				$(this).next('ul').slideUp();
			}else{
				$(this).next('ul').slideDown();
			}
		});
	})	
	
	$(document).ready(function(){
	  $(".click").click(function(){
	  $(".tip").fadeIn(200);
	  });
	  
	  $(".tiptop a").click(function(){
	  $(".tip").fadeOut(200);
	});
	
	  $(".sure").click(function(){
	  $(".tip").fadeOut(100);
	});
	
	  $(".cancel").click(function(){
	  $(".tip").fadeOut(100);
	});
	
	});
	
	//tabl 切换
	$(document).ready(function(e) {
		$('#sel li').click(function(){
			$(".tab-front").removeClass("tab-front").addClass("tab-back");
			$('#sel li a').removeClass();	
			$(this).find('a').attr('class','selected');
			$(this).removeClass("tab-back").addClass("tab-front");
			var i = $(this).index();
			$(".tabbody-div").hide();
			$(".tabbody-div").eq(i).show();
		});
	});
</script>

</head>

<body>
<div class="place"> <span>位置：</span>
  <ul class="placeul">
    <li>首页</li>
    <li>友情链接</li>
  </ul>
</div>
<div class="rightinfo">
<form action="<?php echo U('Goods/sorts');?>" method="post" >
  <div class="tools">
    <ul class="toolbar">
      <a href="<?php echo U('Goods/add');?>"><li><span><img src="/wwyl/Public/Admin/images/t01.png" /></span>添加</li></a> 	  
      
      </a>
    </ul>
  </div>
  <table class="tablelist">
    <thead>
      <tr>
        <th>ID</th>
        <th>商品名称</th>
        <th>商品图片</th>
        <th>商品价格</th>
        <th>商品数量</th>
        <th>添加时间</th>
        <th>商品简介</th>
        <th>操作</th>
      </tr>
    </thead>
    <tbody>
      <?php if(is_array($goods)): foreach($goods as $key=>$v): ?><tr id='<?php echo ($v["id"]); ?>' pid='<?php echo ($v["pid"]); ?>'>
          <td><?php echo ($v['id']); ?></td>
          <td><?php echo ($v['name']); ?></td>
          
          <td>
            <?php if( $v['pic'] != '' ): ?><img src="/wwyl/<?php echo ($v['pic']); ?>" width="80" height="40">
              <?php else: ?><img src="<?php echo C('NO_PIC');?>"  width="80" height="40"><?php endif; ?>    
            </td>
          <td><?php echo ($v['price']); ?></td>
          <td><?php echo ($v['num']); ?></td>
          <td><?php echo date('Y-m-d H:i:s',$v['addtime']) ?></td>
          <td><?php echo ($v['desc']); ?></td>

          <td>
<a href="<?php echo U('Goods/edit',array('id' => $v['id']));?>" class="tablelink">编辑</a>&nbsp;&nbsp;|&nbsp;&nbsp; 
<a href="<?php echo U('Goods/del',array('id' => $v['id']));?>" class="tablelink" onclick="return confirm('确实要删除吗？')">删除</a>&nbsp;&nbsp;

          </td>
        </tr><?php endforeach; endif; ?>
    </tbody>
  </table>
</form> 
</div>
</body>
</html>